<template>
  <div class="detail-box">
    <DetailSearch />
    <div class="main-box">
      <DetailBanner :goodslist="goodslist" />
      <!-- <DetailBanner /> -->
      <DetailNike :shopid="shopid"/>
    </div>
    <DetailFooter />
  </div>
</template>

<script>
import DetailBanner from "../vivw-com/DetailBanner.vue";
import DetailMain from "../vivw-com/DetailMain.vue";
import DetailTure from "../vivw-com/DetailTure.vue";
import DetailNike from "../vivw-com/DetailNike.vue";
import DetailFooter from "../vivw-com/DetailFooter.vue";
import DetailSearch from "../vivw-com/DetailSearch.vue";
import mouth from "../../../../public/utils/mouth";
export default {
  data() {
    return {
      goodslist: [],
      shopid: this.$route.query.id,
    };
  },
  name: "DetailAll",
  components: {
    DetailSearch,
    DetailBanner,
    DetailMain,
    DetailTure,
    DetailNike,
    DetailFooter,
  },
  methods: {
     // addshopcart(){
    //      mouth.get("/goods/findOne/1",{
    //       // params:{
    //       //   id:"1"
    //       // }
    //      })
    //     .then((res) => {
    //       // this.shopList = res.data;
    //       console.log(res.data);
    //     })
    //     .catch((err) => {
    //       console.log("出错了", err);
    //     });
    // }
    listGoods() {
      mouth
        .get("/comments", {
          params: {
            goodsid: this.shopid,
          },
        })
        .then((res) => {
          this.goodslist = res.data[0];
          console.log(res.data[0]);
        })
        .catch((err) => {
          console.log("出错了", err);
        });
    },
  },
  created() {
    console.log(this.shopid, "==-=-=");
    this.listGoods();
  },
};
</script>

<style scoped>
/* .detail-box {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.main-box {
  flex: 1;
  overflow: auto;
} */
</style>